import Cookies from "js-cookie";

export function loc_setItem(name, val) {
  try {
    localStorage.setItem(name, val)
  }
  catch (err) {
    Cookies.set(name, val);
  }
}

export function loc_getItem(name) {
  try {
    return localStorage.getItem(name)
  }
  catch (err) {
    return Cookies.get(name);
  }
}

export function loc_removeItem(name) {
  try {
    return localStorage.removeItem(name)
  }
  catch (err) {
    return Cookies.remove(name);
  }
}
